#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
/*#define a(x,y)  x % y 


int main()
{
	int a = 13, b = 94;
	int c = a(94, 13 + 4);
	printf("%d\n", c);
	/*return 0;
//}*/
//int main()
//{
//	int i = 0;
//	int j = 0;
//	if ((++i > 0) || (++j > 0)) {
//		printf("i=%d;j=%d\n", i, j);
//	}
//}
void InsertSort(int* arr,int sz)
{

	int len = sz - 1;
	int i = 0;
	for (i = 0; i < len ; i++)
	{
		int end = i;
		int key = arr[end + 1];
		while (end >= 0)
		{
			if (arr[end] > key)
			{
				arr[end + 1] = arr[end];
				end--;
			}
			else
			{
				break;
			}
		}
		arr[end + 1] = key;
	}
}
int main()
{
	int arr[10] = { 6,3,1,2,9,5,7,8,4,0 };
	int k = 0;
	int sz = sizeof(arr)/sizeof(arr[0]);
	scanf("%d", &k);
	InsertSort(arr,sz);
	printf("%d", arr[k - 1]);
	return 0;
}